//
//  LoadingHelper.m
//  Refresh
//
//  Created by ning liu on 2018/3/15.
//  Copyright © 2018年 ning liu. All rights reserved.
//

#import "LoadingHelper.h"
#import "LoadingPopView.h"

#define PopTag 0x4d2e
@implementation LoadingHelper

+(void)showLoadingOnView:(UIView *)view
{
    LoadingPopView *popView = [[LoadingPopView alloc]initWithFrame:CGRectMake(0, 0, 200, 150)];
    popView.center = CGPointMake(view.frame.size.width/2.0f, view.frame.size.height/2.0f);
    popView.tag = PopTag;
    [view addSubview:popView];
}

+(void)removeLoadingOnView:(UIView *)view
{
    UIView *popView = [view viewWithTag:PopTag];
    if (popView) {
        [popView removeFromSuperview];
    }
}

+(BOOL)isLoadingFromView:(UIView *)view
{
    if ([view viewWithTag:PopTag]) {
        return YES;
    }
    
    return NO;
}

@end
